import 'package:car_map/widget/widget_input_button.dart';
import 'package:car_map/widget/widget_num_operating.dart';
import 'package:car_map/widget/widget_switch_select.dart';
import 'package:flutter/material.dart';

///系统设置
class SettingPage extends StatefulWidget{
  @override
  _settingState createState()=>_settingState();
}

class _settingState extends State<SettingPage>{
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      appBar: AppBar(
        title: Text('设置'),
      ),body: Container(
      child: ListView(
        children: <Widget>[
          getItemList('刷新间隔',Icons.repeat,widget:WidgetNumOperating()),
          getItemList('车牌',Icons.explicit,widget: WidgetSwitchSelect(leftTitle: '显示',rightTitle: '隐藏',isState: true,)),
          getItemList('标注',Icons.add_location,widget: WidgetSwitchSelect(leftTitle: '显示',rightTitle: '隐藏',isState: false,)),
          getItemList('附近车辆',Icons.directions_car,widget: WidgetSwitchSelect(leftTitle: '显示',rightTitle: '隐藏',isState: true,)),
          getItemList('设防',Icons.beenhere,widget: WidgetSwitchSelect(leftTitle: '显示',rightTitle: '隐藏',isState: false,)),
          getItemList('刷新复位',Icons.my_location,widget: WidgetSwitchSelect(leftTitle: '显示',rightTitle: '隐藏',isState: false,)),
          getItemList('图标说明',Icons.play_for_work,widget: WidgetSwitchSelect(leftTitle: '显示',rightTitle: '隐藏',isState: true,)),
          getItemList('消息接收',Icons.sms,widget: Icon(Icons.navigate_next)),
          getItemList('报警设置',Icons.notification_important,widget: Icon(Icons.navigate_next)),
          getItemList('油价设置',Icons.local_gas_station,widget: WidgetInputButton()),
          getItemList('停车设置',Icons.local_parking,widget: WidgetInputButton()),
          getItemList('视频播放时长',Icons.voice_chat,widget: WidgetInputButton()),
          getItemList('视频服务器',Icons.room_service,widget: WidgetInputButton()),
          getItemList('视频端口',Icons.settings_input_component,widget: WidgetInputButton()),
          getItemList('查岗',Icons.work,widget: WidgetInputButton()),
        ],
      ),
    ),
    );
  }

  Widget getItemList(String title,IconData iconData,{Widget widget}){
    return Container(
      decoration: BoxDecoration(
          border: Border(
              bottom: BorderSide(
                  color: Colors.black12,
                  width: 0.5
              )
          )
      ),
      child: ListTile(
        leading: Icon(iconData,color: Colors.blue,),//
        title: Text(title),
        trailing:widget ,
      ),
    );
  }
}